'Declaration Public Overloads Sub AddHyperlink( _ ByVal address As String, _ ByVal textRuns As IList(Of TextRun), _ ByVal toolTipText As String _ )
public void AddHyperlink( string address, IList<TextRun> textRuns, string toolTipText )
Exception | Description |
---|---|
WordDocumentWriterException | Thrown if no document or paragraph is currently open. |
WordDocumentWriterXmlWriterException | Thrown if the XmlWriter used to write content to the stream throws an exception. |
This overload makes it possible for the developer to display text with mixed font attributes in the hyperlink. Each text fragment with different font attributes must be manifested as a separate text run. Each one is added to the textRuns list prior to calling the method.
Before the AddHyperlink method can be called, the developer must begin a paragraph via the StartParagraph method, or an exception is thrown.
In the case where the address begins with "www.", the prefix "http://" will be prepended to avoid creating a malformed URI.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2